<?php
session_start();

// 生成新验证码
$a = rand(2, 9);
$b = rand(2, 9);
$_SESSION['captcha_code'] = $a * $b;

// 返回新问题
echo json_encode([
    'question' => $a . ' × ' . $b . ' ='
]);